/*===== 函数开始 =====*/
/*重置舵机，即相机归位*/
void servo_reset(void){
hServo.write(H_default);
vServo.write(V_default);
delay(50);
}
/*设置舵机位置*/
void servo_set(int h,int v){
hServo.write(h);
vServo.write(v);
delay(250);
}
/*搜寻函数，根据具体的搜寻模式*/
void search_object(int model){
  int start_time = millis();
  if (model==1)
  {
      Serial.print("run model 1");
    for(int v_angle = V_MIN;v_angle<=V_MAX-90;v_angle+=20)
    {
      for(int h_angle = H_MIN;h_angle<=H_MAX;h_angle+=4)
      {
        servo_set(h_angle,v_angle);
      }
      v_angle+=20;
      for(int h_angle = H_MAX;h_angle>=H_MIN;h_angle-=4)
      {
        servo_set(h_angle,v_angle);
      }
    }
  }
  else if (model==2)
  {
      Serial.print("run model 2");
    for(int h_angle = H_MIN;h_angle<=H_MAX;h_angle+=5)
    {
      for(int v_angle = V_MIN;v_angle<=V_MAX-90;v_angle+=10)
      {
        servo_set(h_angle,v_angle);
      }
      h_angle+=20;
      for(int v_angle = V_MAX-90;v_angle>=V_MIN;v_angle-=10)
      {
        servo_set(h_angle,v_angle);
      }
    }
  }
  else
  {
    ;
  }
  int end_time = millis();
  finall_mcu_time = (end_time-start_time)/1000;
  Serial.print("waste time : ");
  Serial.print(finall_mcu_time);
    Serial.print("s\n");
  delay(2000);
}
